const app = getApp();
var WxParse = require('../../untils/wxParse/wxParse.js')
Page({
  data: {
    arrays: [
      {
        image: '../../images/jidixiangqing/qizi.png',
        region: '所在地区',
        address: ''
      },
      {
        image: '../../images/jidixiangqing/dizhi.png',
        region: '详细地址',
        address: '12321'
      },
      {
        image: '../../images/jidixiangqing/lanxiren.png',
        region: '联系人',
        address: ''
      },
      {
        image: '../../images/jidixiangqing/dianhua.png',
        region: '联系方式',
        address: ''
      },
      {
        image: '../../images/jidixiangqing/jianjie.png',
        region: '简介',
        address: ''
      }
    ],
    content:'',
  },
  onLoad: function (opt) {
    wx.setNavigationBarTitle({
      title: '基地详情',
    });
    this.initPage(opt)
  },
  initPage: function (opt) {
    var _this = this;
    var baseid = opt.id;
    app.doReq(app.globalData.SERVICE.INDEX.ACTIVITYBASEDETAIL, {
      "id": baseid
    }, 'GET', function (res) {
      var article = res.data.obj.content;
      WxParse.wxParse('article', 'html', article, _this);
      _this.setData({
        mainInfo: res.data.obj,
        arrays: [
          {
            image: '../../images/jidixiangqing/qizi.png',
            region: '所在地区',
            address: res.data.obj.sregion.name + res.data.obj.cregion.name +
            res.data.obj.xregion.name
          },
          {
            image: '../../images/jidixiangqing/dizhi.png',
            region: '详细地址',
            address: res.data.obj.address
          },
          {
            image: '../../images/jidixiangqing/lanxiren.png',
            region: '联系人',
            address: res.data.obj.person
          },
          {
            image: '../../images/jidixiangqing/dianhua.png',
            region: '联系方式',
            address: res.data.obj.phone
          },
        ],

      })
    });
  },
})